package com.sss.otep.orm.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
@Embeddable
public class RecordInfo implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3522187242299516145L;
	public RecordInfo(){
		
	}
	public RecordInfo(RecordStatus status,String createUser,Date createDTM, String lastUPDUser, Date lastUPDDTM){
		this.setRecordStatus(status);
		this.setCreateUser(createUser);
		this.setCreateDTM(createDTM);
		this.setLastUPDUser(lastUPDUser);
		this.setLastUPDDTM(lastUPDDTM);
	}
	
	@Column(name="RECORD_STATUS",length=1,nullable=false)
	@Enumerated(EnumType.STRING)	
	private RecordStatus recordStatus;
	
	@Column(name="CREATE_USER")
	private String createUser;
	
	@Column(name="CREATE_DTM", nullable=false)
	@Temporal(TemporalType.DATE)
	private Date createDTM;
	
	@Column(name="LAST_UPD_USER")	
	private String lastUPDUser;
	
	@Column(name="LAST_UPD_DTM")
	@Temporal(TemporalType.DATE)
	private Date lastUPDDTM;
	
	public RecordStatus getRecordStatus() {
		return recordStatus;
	}
	public void setRecordStatus(RecordStatus recordStatus) {
		this.recordStatus = recordStatus;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public Date getCreateDTM() {
		return createDTM;
	}
	public void setCreateDTM(Date createDTM) {
		this.createDTM = createDTM;
	}
	public String getLastUPDUser() {
		return lastUPDUser;
	}
	public void setLastUPDUser(String lastUPDUser) {
		this.lastUPDUser = lastUPDUser;
	}
	public Date getLastUPDDTM() {
		return lastUPDDTM;
	}
	public void setLastUPDDTM(Date lastUPDDTM) {
		this.lastUPDDTM = lastUPDDTM;
	}
	
	@Transient
	public static RecordInfo getNormalRecord(){
		return new RecordInfo(RecordStatus.N, "dummy", new Date(), null, null);
	}
}
